package Demo2;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-06-14
 * Time: 18:24
 */
public class Test {
    public static void main(String[] args) {
        Graph[] graphs = new Graph[]{new Rotundity(),new Square(),new Triangle()};
        for (int i = 0; i < graphs.length; i++) {
            if(graphs[i] instanceof Rotundity rotundity){
                rotundity.draw();
            }else if(graphs[i] instanceof Square square){
                square.draw();
            }else if(graphs[i] instanceof Triangle triangle){
                triangle.draw();
            }
        }
    }
}
